package com.king.micro.base.dao;

import com.zeus.framework.dao.mybatis.base.MybatisDaoContext;
import com.king.micro.entity.RoleEntity;
import org.springframework.stereotype.Repository;

import javax.annotation.Resource;

/**
 * @author 赵晓光
 *         created 2017/8/11 18:25
 *         copyright 2017 micro
 * @FileName: RoleDao.java
 * package: com.king.micro.base.dao
 */
@Repository("base.RoleDao")
public class RoleDao {
    private static final String SQLID = "com.king.micro.base.dao.RoleDao";


    @Resource(name = "microbase.mysql.MybatisDaoContext")
    private MybatisDaoContext mybatisDaoContext;

    public RoleEntity findRoleById(long fid) {
        return mybatisDaoContext.findOne(SQLID + ".findRoleById", RoleEntity.class, fid);
    }

    public void updateByPrimaryKey(RoleEntity roleEntity) {
        mybatisDaoContext.update(SQLID + ".updateByFid", roleEntity);
    }
}
